
export const request_http = ({url, method, data}) => {
  return new Promise((resolve, reject) => {
    const obj = {
      url: 'https://api.warmhealth.com.cn' + url,
      method: method,
      data: data,
      header: {
        "content-type": "application/json;charset=UTF-8"
      },
      success: (res) => res.statusCode === 200 
        ? resolve(res.data) 
        : reject(res.data),
      fail: (err) => reject(err)
    }
    wx.request(obj)
  })
}
